package com.example.customapp.mycustomapp.base;

import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Window;

import com.example.customapp.mycustomapp.utils.AppManager;
import com.zhy.autolayout.AutoLayoutActivity;


public abstract class BaseActivity extends AutoLayoutActivity {
    public abstract void initWidget();

    public abstract void widgetClick();

    @Override
    protected void onCreate(Bundle savedInstancee) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);//禁止橫屏
        requestWindowFeature(Window.FEATURE_NO_TITLE); // 取消标题
        super.onCreate(savedInstancee);
        AppManager.getAppManager().addActivity(this);

        initWidget();
        widgetClick();
    }

    @Override
    protected void onStart() {
        super.onStart();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onRestart() {
        super.onRestart();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        AppManager.getAppManager().finishActivity(this);
    }


}